import matplotlib.pyplot as plt
import numpy as np
plt.plot([1,2,3,4])
plt.plot([1,1,3]) # 倒过来成为卷积核，然后在上述的数组中滑动，得到结果
end_1=np.convolve([1,2,3,4],[1,1,3],'full')
end_2=np.convolve([1,2,3,4],[1,1,3],'same')
end_3=np.convolve([1,2,3,4],[1,1,3],'valid')
plt.plot(end_1)
print(end_1)
print(end_2)
print(end_3)
plt.show()
